home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v8n09.arc / CALC.BAT < prev    next >
DOS Batch File  |  1989-04-26  |  653b  |  28 lines

  1. ECHO OFF
  2. REM  CALC.BAT - BY:  Randy J Guyan
  3. CLS
  4. IF "%1"==""  GOTO no_expression
  5. IF "%2"==""  GOTO just_answer
  6. IF "%2"=="#" GOTO show_equation
  7. GOTO error
  8. :just_answer
  9. ECHO 1?"Ans= ";%1:SYSTEM>Q.X
  10. GOTO continue
  11. :show_equation
  12. ECHO 1?"%1= ";%1:SYSTEM>Q.X
  13. :continue
  14. IF NOT EXIST Q.X GOTO error
  15. BASICA Q.X
  16. ERASE Q.X
  17. GOTO end
  18. :error
  19. ECHO Sorry, an error has occurred --- please check your equation.
  20. ECHO Max len= 100.  If you enter '#' (w/o quotes) as a second
  21. ECHO parameter, the maximum len= 50.  You may not put any spaces
  22. ECHO in your equation.
  23. IF EXIST Q ERASE Q
  24. GOTO end
  25. :no_expression
  26. ECHO No expression was specified!
  27. :end
  28.